# coding: utf-8
# author: errorcpp@qq.com
# dpkg -L pybind11-dev
# find /usr/lib /usr/lib/x86_64-linux-gnu -name "libpython3.*"

MESSAGE("---: finding xpybind11")

find_path(XPYBIND11_INC_DIR pybind11.h
    HINTS  # 额外搜索路径
    ${_CUSTOM_XPYBIND11_BASE_DIR}
    $ENV{INCLUDE}  # VS编译器的include路径变量
    PATH_SUFFIXES include  # 额外的附加子目录
    PATHS
    /usr /usr/local /usr/include /usr/local/include /usr/include/pybind11/
)

# 检查是否找到Python3开发库
if(XPYBIND11_INC_DIR)
    set(XPYBIND11_FOUND TRUE)
    MESSAGE("---: found xpybind11: XPYBIND11_FOUND=" ${XPYBIND11_FOUND})
    MESSAGE("---: found xpybind11: XPYBIND11_INC_DIR=" ${XPYBIND11_INC_DIR})
else()
    set(XPYBIND11_FOUND FALSE)
    MESSAGE("---: faild to find xpybind11")
endif()

# 导出变量
if(XPYBIND11_FOUND)
  mark_as_advanced(XPYBIND11_FOUND XPYBIND11_INC_DIR)
endif()